package org.server.http;

import java.io.IOException;
import java.net.Socket;
import java.net.SocketException;
import java.net.SocketTimeoutException;

import org.server.http.core.ServletFiexdExector;
import org.task.queue.QueueAssignment;

/**
 * 处理线程
 * 
 * @author Admin
 * 
 */
public class SchedHandler implements QueueAssignment {

	private Socket socket;

	/**
	 * 构造
	 * 
	 * @param sock
	 */
	public SchedHandler(Socket sock) {
		socket = sock;
	}

	/**
	 * 重写执行方法
	 */
	@Override
	public void execute() {
		// ServletHandler.execute(socket);
		ServletFiexdExector handler = null;
		try {
			handler = new ServletFiexdExector(socket);
			handler.execute();
		} catch (SocketException e) {
			// e.printStackTrace();
		} catch (SocketTimeoutException e) {
			// e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			// e.printStackTrace();
		} finally {
			if (handler != null) {
				handler.close();
			}
		}

	}

}
